package com.yeung.exam;

import java.util.Arrays;
import java.util.Scanner;

/**
 * 6
 * 5 3 8 3 2 5
 * <p>
 * <p>
 * 3 3 5 4 4 4
 */
public class 小Q看楼 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
        int[] builds = new int[count];
        int[] res = new int[count];
        int x = 0;
        while (x < count) {
            builds[x] = scanner.nextInt();
            x++;
        }
        //寻找可以看到的楼
        for (int i = 0; i < builds.length; i++) {
            int cans = 1;
            int[] left = Arrays.copyOfRange(builds, 0, i);
            int[] right = Arrays.copyOfRange(builds, i, builds.length - 1);
            //找左边
            int maxL = findBigest(left);
            boolean isfl = true;
            for (int ld = i - 1; ld >= 0; ld--) {
                if (isfl) {
                    maxL = builds[ld];
                    isfl = false;
                    cans++;
                } else {
                    if (builds[ld] >= maxL) {
                        cans++;
                        maxL = builds[ld];
                    }
                }
            }
            int maxR = findBigest(right);
            boolean isfr = true;
            //找右边\
            for (int rd = i + 1; rd < builds.length; rd++) {
                if (isfr) {
                    maxL = builds[rd];
                    isfr = false;
                    cans++;
                } else {
                    if (builds[rd] >= maxL) {
                        cans++;
                        maxL = builds[rd];
                    }
                }
            }
            res[i] = cans;
        }
        for (int r : res)
            System.out.print(r + " ");


    }

    private static int findBigest(int[] arr) {
        int max = Integer.MIN_VALUE;
        int index = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > max) {
                max = arr[i];
                index = i;
            }
        }
        return index;
    }
}
